#ifndef SUB_CONTROLL_VIEW_H
#define SUB_CONTROLL_VIEW_H

#include <goocanvas.h>
#include <map>

#include <view.h>
#include <systemSettingMessage.h>
#include <subControllItem.h>
#include <allFactory.h>

namespace View {

  enum SubControllViewPosition{
    SUB_VIEW_POSITION_LEFT_TOP = 0,
    SUB_VIEW_POSITION_LEFT_MID,
    SUB_VIEW_POSITION_LEFT_BOTTOM,
    SUB_VIEW_POSITION_MID_TOP,
    SUB_VIEW_POSITION_MID_BOTTOM,
    SUB_VIEW_POSITION_RIGHT_TOP,
    SUB_VIEW_POSITION_RIGHT_MID,
    SUB_VIEW_POSITION_RIGHT_BOTTOM
  };

  class SubControllView : public view
  {
    GooCanvasItem *root;
    std::map<Model::AttackType,SubControllItem*> subControllItems;
    Model::AttackType currentOnShowItem;
    SubControllViewPosition position;
    bool stillMovingSubItem;

  public:
    SubControllView(GooCanvasItem *parent);
    ~SubControllView();

    bool AddSubControllItem(Model::AttackType attackType);
    bool DelSubControllItem(Model::AttackType attackType);

    virtual bool ReceiveBroadcast(Controller::Broadcast *broadcast);
  };

}

#endif
